# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Stefan Wagner <stw@bit-strickerei.de>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-cairocffi
_pkgname=cairocffi
pkgver=1.7.1
pkgrel=0
pkgdesc="Python CFFI-based binding to Cairo and GDK-PixBuf"
url="https://github.com/Kozea/cairocffi"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-cffi cairo gdk-pixbuf py3-xcffib"
makedepends="py3-gpep517 py3-flit-core py3-wheel py3-installer"
checkdepends="
	font-dejavu
	py3-numpy
	py3-pikepdf
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-cairocffi" # For backwards compatibiltiy
provides="py-cairocffi=$pkgver-r$pkgrel" # For backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/cairocffi*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/cairocffi*.whl
}

sha512sums="
1d0c069c0af4ba552312e7fc003461bf321725212888938cafee168574f8927ce7d6860c016ba972343e67cb59a588fc98c198c75ce3ee3d75aa77874364e190  cairocffi-1.7.1.tar.gz
"
